package com.winona.ui;

import android.content.Intent;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

import com.taplinker.client.R;
import com.winona.Base1Activity;

public class AboutActivity extends Base1Activity {
	private TextView title;
	private ImageView back;
	private Intent intent;
	private View about_introduction, about_version, about_me;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.about);
		findView();
		title.setText("关于");
		setListener();

	}

	private void findView() {
		title = (TextView) findViewById(R.id.about_title);
		back = (ImageView) findViewById(R.id.about_back);
		about_introduction = findViewById(R.id.about_introduction);
		about_version = findViewById(R.id.about_version);
		about_me = findViewById(R.id.about_me);

	}

	private void setListener() {
		back.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				intent = new Intent(AboutActivity.this,
						PersonalSettingActivity.class);
				startActivity(intent);
				overridePendingTransition(R.anim.input, R.anim.out);

			}
		});
		about_introduction.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				intent = new Intent(AboutActivity.this,
						IntroductionAcitivty.class);
				startActivity(intent);
				overridePendingTransition(R.anim.input, R.anim.out);
			}
		});
		about_version.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				intent = new Intent(AboutActivity.this, VersionAcitivty.class);
				startActivity(intent);
				overridePendingTransition(R.anim.input, R.anim.out);
			}
		});
		about_me.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				intent = new Intent(AboutActivity.this, AboutWeAcitivty.class);
				startActivity(intent);
				overridePendingTransition(R.anim.input, R.anim.out);
			}
		});
	}

	@Override
	public boolean onKeyDown(int keyCode, KeyEvent event) {
		if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0) { // 按下的如果是BACK，同时没有重复

			startActivity(PersonalSettingActivity.class);

			return true;
		}

		return super.onKeyDown(keyCode, event);
	}

}
